package com.tsingtao.springboot2.dto;

import lombok.*;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.FieldType;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@IndexName(value = "document")
public class Document {

    /**
     * es中的唯一id
     */
    @IndexId
    private String id;

    /**
     * 文档标题
     */
    @IndexField
    private String title;

    /**
     * 文档内容
     */
    @IndexField
    private String content;

    // 场景五:支持日期字段在es索引中的format类型
    @IndexField(fieldType = FieldType.DATE, dateFormat = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private String gmtCreate;


}
